#include<iostream>

using namespace std;

const int N =1000;
int a[N],b[N];

int main(){
	int s,i,count1=0;
	while(cin>>s){
		count1++;
		if(count1%2==1){
			a[i]=s;
		}else{
			b[i++]=s;
		}
		char c=getchar();//应该是get了下一个
		if(c=='\n')
			break;;

	}

	// cout<<i<<" "<<count1;
	int flag=0;
	for(int j=0;j<i;j++){
		if(j==0&&a[j]*b[j]!=0){
			flag=1;
			cout<<a[j]*b[j]<<" "<<b[j]-1;
		}
		else if(a[j]*b[j]!=0){
			cout<<" "<<a[j]*b[j]<<" "<<b[j]-1;
		}
	}
	if(flag==0){
		cout<<"0 0";
	}

	return 0;

}